﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace Analysis
{
    public partial class frmListe : XtraForm
    {
        public string CariKod { get; set; }
        public DataTable DataSource { get; set; }

        public frmListe()
        {
            InitializeComponent();
        }

        private void frmListe_Load(object sender, EventArgs e)
        {
            gridControl1.DataSource = this.DataSource;
            gridView1.BestFitColumns();
        }

        private void gridControl1_DoubleClick(object sender, EventArgs e)
        {
            this.CariKod = gridView1.GetFocusedRowCellValue(gridView1.Columns["Cari Kodu"]).ToString();
            DialogResult = DialogResult.OK;
            this.Close();
        }

        private void gridControl1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode== Keys.Enter)
            {
                this.CariKod = gridView1.GetFocusedRowCellValue(gridView1.Columns["Cari Kodu"]).ToString();
                DialogResult = DialogResult.OK;
                this.Close();
            }
        }
    }
}
